package myUtil;

public class deviceCheck {

    public static boolean checkNumber(String number) {
        if (number == null || number.length() != 10
                || !number.matches("^[a-zA-Z]\\d{9}$")) {
            return false;
        }

        return true;
    }

    public static boolean checkS(String s, int length) {
        if (s == null || s.length() >= length) {
            return false;
        } else {
            return true;
        }
    }

    public static boolean checkTime(String time) {
        if (time == null || !time.matches("^[0-9]*[天月年]")) {
            return false;
        }
        return true;
    }

    public static boolean checkPhone(String phone) {
        if (phone == null || !phone.matches("^[0-9]*$")
                || (phone.length() != 5 && phone.length() != 11)) {
            return false;
        }
        return true;
    }
}
